import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import type { AppConfig } from './configuration.type';

@Injectable()
export class ConfigurationService {
  constructor(private configService: ConfigService<AppConfig, true>) {}

  get app(): AppConfig {
    return this.configService.get<AppConfig>('app', { infer: true });
  }
}
